function ajaxClass(){
var xmlHttp;
try{
   // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
}catch (e){
  // Internet Explorer
   try{
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
   catch (e){
      try{
         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
         }
      catch (e){
         alert("您的浏览器不支持AJAX！");
         return false;
         }
      }
    }
return xmlHttp;
}
function sendPostRequest(xmlHttp,url,postStr,callback){
	xmlHttp.open("post",url,true);
	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	xmlHttp.onreadystatechange = function(){
		 if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
		 	 callback;
   		} 
	}
	xmlHttp.send(postStr);
}
function sendGetRequest(url){
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	xmlHttp.onreadystatechange = function(){
		 if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { 
    		var feiLeiDiv = document.getElementById("feileidiv");
			var addFriend = document.getElementById("addFriend");
			addFriend.removeChild(feiLeiDiv);
			var options = document.getElementById("managefenleis");
	 
			var xml = xmlHttp.responseXML.documentElement;
			var newClassId = xml.firstChild.firstChild.data;
			var newClassName = xml.lastChild.firstChild.data;
			var newOption = document.createElement("option");
			var textNode = document.createTextNode(newClassName);
			newOption.appendChild(textNode);
			newOption.setAttribute("value",newClassId);
			newOption.setAttribute("selected","selected");
			options.appendChild(newOption);
			closeBgchop();
   		} 
	}
}
